package titt.util.deploy;

import titt.util.JAR;

public class JARCache implements Cache {

	private final Cache c;
	
	public JARCache(Cache c) {
		this.c = c;
		try {
			if(JAR.get().isJAR())
				update();
		}
		catch(Exception e) {}
	}
	
	@Override
	public String getMimeType() {
		return c.getMimeType();
	}

	@Override
	public byte[] getValue() {
		return c.getValue();
	}

	@Override
	public boolean isOutdated() {
		return !JAR.get().isJAR() && c.isOutdated();
	}

	@Override
	public void update() throws Exception {
		c.update();
	}

}
